/*
i,j两人情况
设S为前面所有人的a乘积
1. i在j前
max(i,j)=max(s/b[i],s*a[i]/b[j])=s*max(1/b[i],a[i]/b[j])
2. j在i前
max(i,j)=max(s*a[j]/b[i],s/b[j])=s*max(a[j]/b[i],1/b[j])
3.是否交换

s*max(1/b[i],a[i]/b[j])  s*max(a[j]/b[i],1/b[j])
        i前j后              j前i后
s*max(b[j],a[i]*b[i])  s*max(a[j]*b[j],b[i])
因为所有数>0
所以谁放前面最大值取决于前面的a*b所以a*b小的放前面，大的放后面
*/

#include <algorithm>
#include <cstdint>
#include <iostream>
#include <ostream>
#include <string>
#include <tuple>
#include <vector>
using ll = int64_t;
using int128_t = __int128;
// using int128_t = ll;
ll n;
std::vector<std::tuple<int128_t,ll,ll>> v;

std::ostream&operator<<(std::ostream&os,int128_t i){
    std::string s;
    do {
        char tmp = i%10;
        i/=10;
        s=char(tmp+'0')+s;
    }while (i);
    os<<s;
    return os;
}
struct BigInt{
    std::vector<ll>v;
    ll getFirst()const{
        for(ll i=v.size()-1;i>=0;i--){
            if(v[i]!=0)return i;
        }
        return 0;
    }
    bool isZero()const{
        return getFirst()==0&&v[0]==0;
    }
    BigInt(ll n=0):v(100){
        set(n);
    }
    void set(ll n){
        for(ll i=0;i<(ll)v.size();i++){
            v[i]=0;
        }
        ll idx{};
        while(n){
            v[idx]=n%10;
            n/=10;
            idx++;
        }
    }
    BigInt operator*(ll n)const{
        BigInt res;
        ll c{};
        for(ll i=0;i<(ll)v.size();i++){
           res.v[i]=v[i]*n;
           res.v[i]+=c;
           c=res.v[i]/10;
           res.v[i]%=10;
        }
        // if(isZero())throw std::runtime_error("is zero");
        return res;
    }
    BigInt operator/(ll n)const{
        BigInt res;
        ll c{};
        bool isOk=false;
        for(ll i=v.size()-1;i>=0;i--){
            if(v[i]!=0||isOk){
                isOk=true;
                c+=v[i];
                res.v[i]=c/n;
                // std::cout<<"res.v[i]:"<<c/n<<'\n';
                c-=(c/n)*n;
                // std::cout<<"c:"<<c<<'\n';
                c*=10;
            }
        }
        // if(isZero())throw std::runtime_error("is zero");
        return res;
    }
    
    
    bool operator>(const BigInt&b){
        ll fa=getFirst();
        ll fb=b.getFirst();
        if(fa!=fb){
            return fa>fb;
        }
        for(ll i=fa;i>=0;i--){
            if(v[i]!=b.v[i]){
                return v[i]>b.v[i];
            }
        }
        return false;
    }
    friend std::ostream&operator<<(std::ostream&os,const BigInt&b){
        bool isOk=false;
        for(ll i=b.v.size()-1;i>=0;i--){
            if(isOk||b.v[i]!=0){
                isOk=true;
                os<<b.v[i];
            }
        }
        if(!isOk)os<<'0';
        return os;
    }
}s=1,ans=1;

int main(){
    // BigInt a=400;
    // BigInt b=a/25;
    // std::cout<<a/25<<'\n';
    // throw std::runtime_error("unreachable");

    std::cin>>n;
    n++;
    v.resize(n+1);
    for(ll i=1;i<=n;i++){
        std::cin>>std::get<1>(v[i])>>std::get<2>(v[i]);
        std::get<0>(v[i])=std::get<1>(v[i])*std::get<2>(v[i]);
    }
    std::sort(v.begin()+2,v.end());
    s=s*std::get<1>(v[1]);
    for(ll i=2;i<(ll)v.size()-1;i++){
        if(auto a = s/std::get<2>(v[i]);a>ans){
            ans=a;
        }
        s=s*std::get<1>(v[i]);
    }
    if(auto a = s/std::get<2>(v[v.size()-1]);a>ans){
        ans=a;
    }
    std::cout<<ans<<'\n';
}